package com.myproject.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myproject.mapper.MapperUser;
import com.myproject.model.SysUser;

@Service
public class SysUserService {
	@Autowired
	private MapperUser mapper;
	
	public List<SysUser> findAllSysUsers(){
		return mapper.findAllSysUsers();
	}
	
	public SysUser findSysUserByUsername(String username){
		if(username == null){
			return null;
		}
		return mapper.findSysUserByUsername(username);
	}
	
	public int registerSysUser(SysUser user){
		return mapper.addSysUser(user);
	}
}
